package org.jeecg.modules.demo.com.kunpeng.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.com.kunpeng.entity.ProjectPurchase;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.com.kunpeng.entity.ProjectPurchaseApply;
import org.jeecg.modules.demo.com.kunpeng.entity.dto.ProjectPurchaseQueryDTO;
import org.jeecg.modules.demo.com.kunpeng.entity.dto.UpdateOaProjectPurchaseDTO;
import org.jeecg.modules.demo.com.kunpeng.vo.OaProjectPurchasePage;
import org.jeecg.modules.demo.com.kunpeng.vo.ProjectPurchaseDetailsVO;
import org.jeecg.modules.demo.com.kunpeng.vo.ProjectPurchaseListQueryVO;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 项目采购表
 * @Author: jeecg-boot
 * @Date:   2022-12-15
 * @Version: V1.0
 */
public interface IProjectPurchaseService extends IService<ProjectPurchase> {

	/**
	 * 添加一对多
	 *
	 * @param projectPurchase
	 */
	public void saveMain(ProjectPurchase projectPurchase, List<ProjectPurchaseApply> projectPurchaseApplyList) ;
	
	/**
	 * 修改一对多
	 *
   * @param projectPurchase
	 */
	public void updateMain(ProjectPurchase projectPurchase,List<ProjectPurchaseApply> projectPurchaseApplyList);
	
	/**
	 * 删除一对多
	 *
	 * @param id
	 */
	public void delMain (String id);
	
	/**
	 * 批量删除一对多
	 *
	 * @param idList
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

	/**
	 * 全局搜索
	 * @param page
	 * @param projectPurchaseQueryDTO
	 * @return
	 */
	Page<ProjectPurchaseListQueryVO> listByKeyWords(Page<ProjectPurchaseListQueryVO> page, ProjectPurchaseQueryDTO projectPurchaseQueryDTO);


	/**
	 * 根据id查询项目采购详情
	 * @param id
	 * @return
	 */
	ProjectPurchaseDetailsVO selectProjectPurchaseDetailsById(String id);

	/**
	 * 根据项目采购表id查询项目采购申请
	 * @param PPId
	 * @return
	 */
	List<ProjectPurchaseApply> listByPPId(String PPId);


	/**
	 * 根据项目编号查询项目采购
	 * @param projectId
	 * @return
	 */
	Page<ProjectPurchaseListQueryVO> listByProjectId(Page<ProjectPurchaseListQueryVO>page,String projectId);

	/**
	 * 根据采购单号前缀模糊查询采购列表
	 */
	Integer listPurchaseIdByPurchaseId(String purchasePrefix);


	/**
	 * 新增采购审批
	 */
	void insertOaProjectPurchase(OaProjectPurchasePage oaProjectPurchasePage);

	/**
	 * 根据id修改项目采购isDelete状态
	 */
	void updateProjectPurchaseIsDeleteById(String id);

	/**
	 * 根据id修改项目费用申请关联数据
	 * @param updateOaProjectPurchaseDTO
	 */
	void updateProjectPurchaseById(UpdateOaProjectPurchaseDTO updateOaProjectPurchaseDTO);
}
